package mcdevitt.id.projects;

import java.util.Collections;
import java.util.Stack;

public class DeckOfCards {
	private Stack<Card> deckOfCards = new Stack<Card>();
	private static final String[] cardFace = { "2", "3", "4", "5", "6", "7",
			"8", "9", "10", "J", "Q", "K", "A" };
	private static final String[] cardSuit = { "\u2660", "\u2663", "\u2665",
			"\u2666" };

	public DeckOfCards(){
	
	//Initiates  deck
	for (int i=0;i<cardSuit.length;i++){
		for(int k=0;k<cardFace.length;k++){
			Card cards=new Card();
			cards.setSuit(cardSuit[i]);
			cards.setFace(cardFace[k]);
			
			
		deckOfCards.push(cards);
		}
		shuffleDeck();
	}
	}
	//shuffles the deck
	public void shuffleDeck(){
		Collections.shuffle(deckOfCards);
		
	}
	//deals card
	public Card dealCard(){
		Card card=deckOfCards.pop();
		return card;
	}
	public void printDeck(){
		for (int j=0;j<deckOfCards.size();j++){
			Card card=deckOfCards.get(j);
			System.out.print(card.getFace());
			System.out.print(" of ");
			System.out.print(card.getSuit());
			System.out.println(" ");
			
			
			
		}
	}
}

